# Zipkin 启动脚本

Write-Host "正在启动 Zipkin 服务..." -ForegroundColor Green

# 检查 Docker 是否运行
$dockerStatus = docker info 2>&1
if ($LASTEXITCODE -ne 0) {
    Write-Host "错误: Docker 未运行，请先启动 Docker Desktop" -ForegroundColor Red
    exit 1
}

# 启动 Zipkin
Write-Host "启动 Zipkin..." -ForegroundColor Cyan
docker-compose -f docker-compose-zipkin.yml up -d

Write-Host ""
Write-Host "等待服务启动..." -ForegroundColor Yellow
Start-Sleep -Seconds 10

# 检查服务状态
Write-Host ""
Write-Host "服务状态:" -ForegroundColor Green
docker-compose -f docker-compose-zipkin.yml ps

Write-Host ""
Write-Host "================================" -ForegroundColor Cyan
Write-Host "Zipkin 服务地址:" -ForegroundColor Green
Write-Host "  Zipkin UI: http://localhost:9411" -ForegroundColor White
Write-Host "================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "使用以下命令查看日志:" -ForegroundColor Yellow
Write-Host "  docker-compose -f docker-compose-zipkin.yml logs -f" -ForegroundColor White
Write-Host ""
Write-Host "停止服务:" -ForegroundColor Yellow
Write-Host "  docker-compose -f docker-compose-zipkin.yml down" -ForegroundColor White